/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.feignimpl.member;

import com.enation.app.javashop.client.member.MemberCommentClient;
import com.enation.app.javashop.core.client.fallback.member.MemberCommentClientFallbackFactory;
import com.enation.app.javashop.core.handler.FeignConfiguration;
import com.enation.app.javashop.model.member.vo.GoodsGrade;
import com.enation.app.javashop.model.trade.order.dto.OrderDetailDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author fk
 * @version v2.0
 * @Description: 会员评论对外接口实现
 * @date 2018/7/31 11:02
 * @since v7.0.0
 */
@FeignClient(name = "member-service", fallbackFactory = MemberCommentClientFallbackFactory.class,configuration = {FeignConfiguration.class})
public interface MemberCommentClientImpl extends MemberCommentClient {

    /**
     * 查询商品的好评比例
     *
     * @return
     */
    @Override
    @RequestMapping(value = "/client/members/comments/grades", method = RequestMethod.GET, consumes = "application/json")
    List<GoodsGrade> queryGoodsGrade();

    /**
     * 根据商品id获取评论数
     *
     * @param goodsId 商品id
     * @return 评论数
     */
    @Override
    @RequestMapping(value = "/client/members/comments/count", method = RequestMethod.GET)
    Integer getGoodsCommentCount(@RequestParam("goods_id") Long goodsId);

    /**
     * 自动好评
     *
     * @param detailDTOList
     */
    @Override
    @RequestMapping(value = "/client/members/comments/auto-good", method = RequestMethod.POST)
    void autoGoodComments(@RequestBody List<OrderDetailDTO> detailDTOList);


    @Override
    @RequestMapping(value = "/client/members/comments/edit-face/{member_id}", method = RequestMethod.PUT)
    void editComment(@PathVariable("member_id") Long memberId, @RequestParam("face")String face);
}
